#include "StoryCellTableWidget.h"

StoryCellTableWidget::StoryCellTableWidget(QWidget *parent)
	: QWidget(parent)
	, ui(new Ui::StoryCellTableWidgetClass())
{
	ui->setupUi(this);
	tableWidget = new QTableWidget(this);
	tableWidget->horizontalHeader()->setHidden(true);
	tableWidget->verticalHeader()->setHidden(true);
	tableWidget->setColumnCount(2);
}

StoryCellTableWidget::~StoryCellTableWidget()
{
	delete ui;
}

void StoryCellTableWidget::setUi(const QVector<StoryCellWidget*>& qVec)
{
	int n = qVec.size();
	tableWidget->setRowCount(n);
	for (int i = 0; i < n; i++)
	{
		tableWidget->setCellWidget(i >> 1, i & 1, qVec[i]);
	}
	adjustSize();
	tableWidget->setMinimumHeight(600);
	tableWidget->setMaximumHeight(600);
}
